﻿using Abp.EntityFrameworkCore;
using Admin.Entities;
using Microsoft.EntityFrameworkCore;

namespace Admin.EntityFrameworkCore
{
    public class AdminDbContext : AbpDbContext
    {
        public AdminDbContext(DbContextOptions options) : base(options)
        {
        }

        public DbSet<User> Users { get; set; }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User>(builder =>
            {
                builder.Property(x => x.Name).HasMaxLength(100);
                builder.HasAlternateKey(x => x.Name);
                builder.Property(x => x.Password).HasMaxLength(100);
            });

            base.OnModelCreating(modelBuilder);
        }
    }
}